The present invention relates to manipulation of computer volume segments without archiving or destroying user data, and more particularly to tools and techniques for resizing, moving, merging, consolidating, scattering, and/or mirroring volume segments such as volume segments found in segmented partition computer systems.
Computers utilize a wide variety of disks as storage media for user data. Disk technologies currently provide optical disks, magnetic disks, hard disks, floppy disks, and removable disks, and new disk technologies are being actively researched and developed. Indeed, some disks used by computers in the future may be cubical or some other shape rather than flat and circular. Investigation into non-volatile semiconductor storage devices is ongoing.
FIG. 1 illustrates a disk 100 attached to a disk drive 102. The disk 100 illustrates physical characteristics of both floppies and hard disks; cubical disks or other disks may appear in different configurations than the one shown here. The disk 100 contains a number of concentric data cylinders such as the cylinder 104. The cylinder 104 contains several data sectors, including sectors 106 and 108. The sectors 106 and 108 are located on an upper side 110 of the disk 100; additional sectors may be located on a lower side 112 of the disk 100. The sides 110, 112 of the disk 100 define a platter 114. A hard disk may contain several platters. The upper side 110 of the disk 100 is accessed by a head 116 mounted on an arm 118 secured to the drive 102. Optical or cubical disks may be accessed by other means, such as photoemitters or photoreceptors.
A given sector on the disk 100 may be identified by specifying a head, a cylinder, and a sector within the cylinder. A triplet specifying the head number, cylinder number, and sector number in this manner is known as a xe2x80x9cphysical sector address.xe2x80x9d Alternatively, a given sector may be identified by a logical sector address, which is a single number rather than a triplet of numbers.
An operating system manages access, not only to the disk 100, but to other computer resources as well. Resources typically managed by the operating system include one or more disks and disk drives, memory (RAM and/or ROM), microprocessors, and I/O devices such as a keyboard, mouse, screen, printer, tape drive, modem, serial port, parallel port, or network port.
Many disks mold the available space into one or more partitions by using a partition table located on the disk. A wide variety of partitions are used, and more partition types will no doubt be defined over time. A partial list of current partitions and their associated file systems is given in U.S. Pat. No. 5,930,831 and incorporated here by reference. The list includes a variety of 12-bit, 16-bit, and 32-bit FAT file systems and numerous other file systems. Tools and techniques for manipulating FAT and certain other partitions are described in U.S. Pat. Nos. 5,675,769, 5,706,472, and 5,930,831 assigned to PowerQuest Corporation, incorporated herein by this reference.
Some file systems provide useful features not available under many existing FAT file systems. Examples include the NT File System (xe2x80x9cNTFSxe2x80x9d) and the Novell NetWare file system (xe2x80x9cNetWare FSxe2x80x9d) (NetWare is a mark of Novell, Inc.). Discussions of NTFS are provided in xe2x80x9cInside the Windows NT File Systemxe2x80x9d, by Helen Custer, ISBN 1-55615-660-X, as well as in marketing and technical materials available in hard copy and on the Internet from Microsoft Corporation and other sources. Discussions of NetWare FS are provided in Chapter 23 of xe2x80x9cNetWare 4For Professionalsxe2x80x9d, by Bierer et al., ISBN 1-56205-217-9, as well as in marketing and technical materials available in hard copy and on the Internet from Novell, Inc. and other sources. Some of the comments herein apply only to certain versions of NetWare, such as those prior to version 5. Those of skill in the art will note that these discussions sometimes involve unimplemented specifications or mere speculations, particularly in the case of NTFS. NTFS features include, without limitation: use of a database paradigm to support indexing of file attributes; multiple data streams per file; blurring of the distinction between system and user areas; recoverability by use of a log; recoverability by use of transactions; support for large disks; security descriptors constraining access to file objects; Unicode names; support for POSIX features such as links; bad cluster remapping; caching support; virtual memory support; system structure compression; balanced tree directory structures; support for suballocation whereby a cluster may hold data belonging to one or more files; support for volume spanning, volume sets, stripe sets, mirror sets, and other features which divide a file system""s contents between disks or partitions; and a relocatable system area.
One partition table composition, denoted herein as the xe2x80x9cIBM-compatiblexe2x80x9d partition table, is found on the disks used in many IBM(copyright) personal computers and IBM-compatible computers (IBM is a registered trademark of International Business Machines Corporation). Although IBM is not the only present source of personal computers, server computers, and computer operating systems and/or file system software, the term xe2x80x9cIBM-compatiblexe2x80x9d is widely used in the industry to distinguish certain computer systems from other computer systems such as Macintosh computer systems produced by Apple Computer (Macintosh is a market of Apple Computer). IBM-compatible partition tables may be used on a wide variety of disks, with a variety of partition and file system types, in a variety of ways.
As shown in FIG. 2, one version of an IBM-compatible partition table 200 includes an Initial Program Loader (xe2x80x9cIPLxe2x80x9d) identifier 202, four primary partition identifiers 204, and a boot identifier 206. As shown in FIG. 3, each partition identifier 204 includes a boot indicator 300 to indicate whether the partition in question is bootable. At most one of the partitions in the set of partitions defined by the partition table 200 is bootable at any given time.
Each partition identifier 204 also includes a starting address 302, which is the physical sector address of the first sector in the partition in question, and an ending address 304, which is the physical sector address of the last sector in the partition. A sector count 306 holds the total number of disk sectors in the partition. A boot sector address 308 holds the logical sector address corresponding to the physical starting address 302.
Some IBM-compatible computer systems allow xe2x80x9clogical partitionsxe2x80x9d as well as the primary partitions just described. All logical partitions are contained within one primary partition; a primary partition which contains logical partitions is also known as an xe2x80x9cextended partition.xe2x80x9d
Each partition identifier 204 also includes a system indicator 310. The system indicator 310 identifies the type of file system contained in the partition, which in turn defines the physical arrangement of data that is stored in the partition on the disk 100 (FIG. 1). Values not recognized by a particular operating system are treated as designating an unknown file system. The file system associated with a specific partition of the disk 100 (FIG. 1) determines the format in which data is stored in the partition, namely, the physical arrangement of user data and of file system structures in the portion of the disk 100 that is delimited by the starting address 302 and the ending address 304 of the partition in question. At any given time, each partition thus contains at most one type of file system.
Some computer systems, such as many using NetWare FS or NTFS, mold disk storage into xe2x80x9csegmented partitionsxe2x80x9d or xe2x80x9csegmented volumesxe2x80x9d with an approach somewhat different from that described above. On such systems, a xe2x80x9cvolumexe2x80x9d is an instance of a file system. Hard drives may be divided into partitions, and volumes may be divided into xe2x80x9csegmentsxe2x80x9d. A xe2x80x9csegmented volumexe2x80x9d is a volume which does or can contain segments, i.e., a segmentable volume. A xe2x80x9csegmented partitionxe2x80x9d is a partition which does or can contain segments, i.e., a segmentable partition. For instance, a type 06 partition is not a segmented partition. A given partition may hold zero or more segments from zero or more volumes which are instances of one or more file systems; the cases of primary interest here are those in which one or more segments from one or more volumes are present.
The file system structures on disk do not necessarily reflect the presence of segments. Some NetWare FS structures can define the location and/or extent of segments, for example, but structures manipulated by NTFS routines do not ordinarily define segment extent or location. Segments may be created with conventional tools in order to improve response times or to provide fault tolerance. For example, in a Microsoft Windows NT environment, the Disk Administrator tool can be used to set up an NTFS volume that spans multiple disk drives. As another example, FIG. 4 illustrates a configuration in which two drives 400, 402 are molded. Drive 400 includes a DOS partition 404 and a first NetWare partition 408, while drive 402 includes an NTFS partition 406 and a second NetWare partition 410. A NetWare partition is a section of a disk 100 which is allocated to NetWare by a partition table; the partitions 404, 406, 408, and 410 are defined using a partition table such as the table shown in FIG. 2. NetWare partitions may not span disks. Segmented partitions in other environments may be subject to the same or similar requirements. Although specific definitions of xe2x80x9cdiskxe2x80x9d and xe2x80x9cdrivexe2x80x9d are given above, those of skill in the art will recognize that these terms are sometimes used interchangeably when the distinction between the media and the controller/drive mechanism is not important.
The first NetWare partition 408 includes two volume segments 412 and 414, and the second NetWare partition 410 includes volume segments 416 and 418. The volume segments 412 and 416 belong to SYS volume 420, while the volume segments 414, 418 belong to a VOL1 volume 422. More generally, a NetWare segment is a section of a NetWare volume, and a NetWare volume is a section of one or more NetWare partitions which is formatted for a file system such as NetWare FS. NetWare partitions can include segments from more than one NetWare volume, but a given NetWare partition can hold at most 8 segments. NetWare volumes can include several NetWare segments on multiple disk drives, and each volume may hold up to 32 segments. Segments and volumes in other environments may be subject to the same or similar requirements.
Those of skill in the art will recognize that FIG. 4 illustrates only one of the many possible configurations. For instance, all segments belonging to a given volume can be stored on the same drive. Likewise, a given segmented partition may hold several segments from a given volume. In addition, a given system will not necessarily contain an NTFS partition, and/or might contain several DOS, FAT16, FAT32, HPFS, NTFS, or other partitions. NetWare FS is a widely used example of a file system whose instances are segmented volumes, but other file systems may also be instantiated with volumes, segments, and partitions in an analogous manner and therefore be suitable for beneficial manipulation according to the present invention. Finally, segmented volumes are used most commonly on computer network servers, but may also be used on client or standalone machines.
It is sometimes desirable to alter the configuration of a computer system which is using NetWare FS or another segmented partition environment. However, even sophisticated approaches to partition manipulation, such as those described in U.S. Pat. Nos. 5,675,769, 5,706,472, and 5,930,831, or in the non-provisional pending applications identified herein, do not fully address either the complexities or the opportunities presented by volume segments. Less advanced approaches are even less helpful.
One conventional approach begins by copying all necessary user and system data off the disk to a temporary storage location such as a tape or additional disk(s). The data copied includes without limitation the contents of files created by the user such as textual documents and spreadsheets, the contents of files required to run applications such as word processors, and system data such as directory information. Some internal file system data such as sector allocation maps may not need to be copied, but is often copied anyway. Familiar disk utilities such as FDISK, the install.nlm and nwconfig.nlm utilities in NetWare that manipulate partitions and volumes, and formatting utilities are then used to update the disks (thereby destroying some or all of the user data on the disk). Finally, the data is copied back into the newly configured disks. During this copying process the file system copy or restore utility creates appropriate new file system structures reflecting the current locations of data on the disk.
This approach to volume segment and partition manipulation has several drawbacks. A temporary storage device with adequate storage capacity may not be readily available or affordable under the circumstances. Even if temporary storage is available, copying large amounts of data from the disk to temporary storage and then back again can take a substantial period of time. In addition, manipulating disks in this manner is confusing and dangerous for many computer users. Users who are unfamiliar with the numerous technical details required as input to the conventional utilities may easily and inadvertently destroy data and/or make it necessary to further modify the disks with FDISK or the install or nwconfig NLMs again, to reformat again, and to once again copy all the data from temporary storage into the reformatted partition. Even if everything works as desired the first time, this approach to partition and/or volume segment modification can be very time-consuming. With a typical disk holding several gigabytes of data the process may require several hours to complete successfully.
Manipulation of volume segments is further complicated when disk contents are subject to disk mirroring or disk duplexing. Disk mirroring and disk duplexing are collectively referred to herein as xe2x80x9cdata duplicatingxe2x80x9d. Under disk mirroring, two hard disks are accessed through a single disk channel. Each time data is sent to the first disk, the same data is subsequently sent to the second disk through the shared channel so that the data will be preserved even if the first disk crashes. Under disk duplexing, two copies of data are sent at the same time through two disk channels to two hard disks. Once again, the goal is to protect the data against loss. With either form of data duplication, volume segment manipulation is complicated by the need to perform the manipulation(s) without substantially increasing the risk of data loss by unsuitable interference with the data duplication process.
Thus, it would be an advancement in the art to provide improved tools and techniques for manipulating volume segments and their attendant partitions.
It would also be an advancement to provide such improved tools and techniques which operate safely and efficiently in the presence of data duplicating.
Such improved tools and techniques are disclosed and claimed herein.
The present invention provides tools and techniques for manipulating volume segments. Possible manipulations include resizing a volume segment, moving a volume segment within a given partition or between partitions, merging two volume segments to create a single volume segment containing the data previously found in the two segments, and variations on these manipulations such as consolidating the segments of a given volume on the smallest possible number of drives or on a given set of drives, scattering the segments of a given volume among several drives, and manipulating mirrored volume segments. The invention also provides tools and techniques for safely and efficiently manipulating a partition that contains volume segments, including the manipulation of volume segments when a NetWare FS or other segmented partition is resized by moving the partition""s left boundary (the boundary closest to the file allocation table).
One embodiment resizes a single segment of a segmented volume by moving the left or right segment boundary and making appropriate adjustments to system tables. This may require relocating the system tables as necessary to make them be correctly located in the segment, that is, to place them where the file system or other system software expects to find them. A segment can be reduced to a minimum size to reduce the amount of space used by the segment. A segment can also be enlarged to a maximum size to include available free space which is adjacent to the segment. The amount of free and used space in other segments of the same volume is not necessarily changed.
Volume segments are reduced by relocating all used blocks as necessary into an area of the segment which is the desired reduced size, and then adjusting file system or other system tables to reflect the new size. Volume segments are enlarged by increasing file allocation tables to reference newly added space and by adjusting system tables to reflect the new size. The NetWare partition xe2x80x9credirection areaxe2x80x9d, also known as the xe2x80x9chot fixxe2x80x9d area, is resized down to the default size when resizing the partition to make the partition smaller.
One embodiment moves a volume segment to free space within a NetWare or other segmented partition. The free space may be adjacent to the segment which is being moved, or the free space may be within the same segmented partition but not adjacent because other volume segments are located between the segment which is being moved and the free space. The free space may also be on a segmented partition on another disk. The user selects a volume segment and selects the free space to which the volume segment will be moved. Only free space that is within a segmented partition, or free space that is not in any partition and that is large enough to accommodate the segment being moved, can be selected. After the volume segment is successfully copied to its new location, the original copy of the segment is deleted. System tables within both the source and destination partitions, such as volume definition tables, are updated to reflect the change.
Sectors that go bad in a NetWare partition are marked and the data that would have been stored in the bad sector is moved to a safe sector in the NetWare redirection area. Bad sectors are similarly avoided in other segmented partitions by using a bad sector file, a bad sector list, or a similar mechanism. During the read portion of a move, the bad sector table is checked, the bad sectors are ignored, and the good sectors and the redirected sectors are moved directly to the new partition, so fewer unnecessary reads of bad sectors are performed. The destination partition may also have bad sectors to avoid by redirecting data. The invention checks the destination""s bad sector table, so that data is written directly to the redirection area instead of onto the bad sectors in the destination partition.
One embodiment combines two NetWare or other segments. The segments must be from the same volume and they must be adjacent to each other in the same segmented partition. They must also be sequential, e.g., volume segment 0 next to volume segment 1, or volume segment 4 next to volume segment 5, but not volume segment 3 next to volume segment 5. The resulting combined volume segment contains all of the original segments"" data, in the same logical location as in the original two segments. The number of segments in the volume and in the segmented partition is reduced by one. This ability is especially useful when users have reached the maximum number of eight volume segments in a NetWare partition (at least two of which are segments from the same volume) and need to create additional segments in that partition.
The user determines which two volume segments will be combined. If necessary, any free space between the two segments is removed so that the two segments are directly adjacent to each other. Free space between the segments may be unaccounted space inside the left segment which is beyond the last block of that segment, or free space may be located between the two segments and not be in use by either segment. If the free space is not on a block boundary of the segments"" volume then all sectors in one segment must be moved until the free space between the segments is on a block boundary or there is no free space between them. Once the segments are directly adjacent to each other, the merge is completed by adjusting the left segment""s size to include the right segment""s data and relocating the file allocation tables as necessary. The left segment becomes the single resulting segment.
Resize, move, and merge manipulations may be combined in various ways to consolidate the segments of a given volume, to scatter the segments of a given volume among several drives, and to efficiently manipulate segments when data duplication (mirroring or duplexing) is being used. Manipulations are performed in a manner which is safe and efficient. Other features and advantages of the present invention will become more fully apparent through the following description.